/**
 * Clase que representa la estructura de la tabla en un objeto Java. Cada
 * atributo de la tabla es creado como variables y su formato como anotaciones
 *
 * @version 1.0, 25/04/12
 * @author jarosemena
 */
package company.allocation;

import java.util.Date;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.RequestScoped;
import system.general.Columna;
import system.general.Table;

@ManagedBean(name = "company_allocationBeans")
@RequestScoped
@Table(nombre = "compania_gps")
public class Beans {

    @Columna(nombre = "id", tipo = "Integer")
    private Integer id = 0;
    private company.general.Beans companyBeans = new company.general.Beans();
    private gps.general.Beans gpsBeans = new gps.general.Beans();

    public Beans() {
    }

    public Beans(int id, int company_id, int gps_id, String company_name, String gps_imei,Date caducidad ) {
        this.id = id;
        this.companyBeans.setId(company_id);
        this.companyBeans.setNombre(company_name);
        this.gpsBeans.setId(gps_id);
        this.gpsBeans.setImei(gps_imei);
         this.gpsBeans.setCaducidad(caducidad);
    }

    /**
     * Método que permite inicializar todas las variables
     */
    public void clearBeans() {
        setId(0);
        this.getCompanyBeans().clearBeans();
        this.getGpsBeans().clearBeans();
    }

    private String strScape(String data) {
        data = data.trim();
        data = data.replace("'", "''");
        data = data.replace("\\", "\\\\");
        return data;
    }

    /**
     * @return the id
     */
    public Integer getId() {
        return id;
    }

    /**
     * @param id the id to set
     */
    public void setId(Integer id) {
        this.id = id;
    }

    /**
     * @return the companyBeans
     */
    public company.general.Beans getCompanyBeans() {
        return companyBeans;
    }

    /**
     * @param companyBeans the companyBeans to set
     */
    public void setCompanyBeans(company.general.Beans companyBeans) {
        this.companyBeans = companyBeans;
    }

    /**
     * @return the gpsBeans
     */
    public gps.general.Beans getGpsBeans() {
        return gpsBeans;
    }

    /**
     * @param gpsBeans the gpsBeans to set
     */
    public void setGpsBeans(gps.general.Beans gpsBeans) {
        this.gpsBeans = gpsBeans;
    }

    
}
